#include <iostream>
using namespace std;

bool palin(char word[], int s, int e);

int main()
{
	char w1[] = "otto";
	char w2[] = "naturrutan";
	char w3[] = "max";

	cout << "palin(otto) = " << palin(w1, 0, (sizeof(w1) / sizeof(char)) - 1 - 1) << endl;			//sizeof(otto) == 5, 4 letters + '\0'
	cout << "palin(naturrutan) = " << palin(w2, 0, (sizeof(w2) / sizeof(char)) - 1 - 1) << endl;	//men sista bokstaven har pos w1[3]
	cout << "palin(max) = " << palin(w3, 0, (sizeof(w3) / sizeof(char)) - 1 - 1) << endl;

	system("pause");
	return 0;
}

bool palin(char word[], int s, int e)
{
	if (s <= e)
	{
		if (word[s] == word[e])
		{
			return palin(word, s + 1, e - 1);
		}
		else
		{
			return false;
		}
	}
	return true;
}